# /**
# * Copyright (c) 2022 Beijing Jiaotong University
# * photlab is licensed under [Open Source License].
# * You can use this software according to the terms and conditions of the [Open Source License].
# *
# * You may obtain a copy of [Open Source License] at: [https://open.source.license/]
# *
# * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# *
# * See the [Open Source License] for more details.
# */
# /**
# * Author: Shihao Xie
# * Created: Jul. 5, 2022
# * Supported by: National Key Research and Development Program of China
# */

namespace py phot_server.rpc.engine_data_type

enum PhotTaskStatus{
    TASK_CREATING = 0,
    TASK_RUNNING = 1,
    TASK_STOPPED = 2,
    TASK_NO_RESPONDING = 3,
    TASK_ACCOMPLISHED = 4,
    TASK_DIED = 5,
}

enum PhotArrayType{
    intArray = 0,
    longArray = 1,
    doubleArray = 2,
    complexDoubleArray = 3,
}

struct PhotOutput{
    1:required i32 componentId,
    2:required i32 portId,
    3:optional string polarization,
    4:optional string signalType,
    5:required list<PhotSignal> signals,
}

struct PhotSignal{
    1:required PhotArrayType type,
    2:required string shape,
    3:optional string orientation,
    4:required PhotArray signal,
}

union PhotArray{
    1:optional PhotComplexDouble complexDoubleArray,
    2:optional list<i32> intArray,
    3:optional list<i64> longArray,
    4:optional list<double> doubleArray,
}

struct PhotComplexDouble{
    1:required list<double> real,
    2:required list<double> imag
}

enum PhotPlotType{
    LINECHART = 0,
    SCATTER = 1,
    TABLE = 2,
    IMAGE = 3,
    LIST = 4,
    VALUE = 5
}

struct PhotAnalyzerOutput{
    1:required string graphId,
    2:required i32 analyzerId,
    3:required PhotPlotType plotType,
    4:required string title,
    5:required string shape,
    6:optional PhotArray x,
    7:optional PhotArray y,
    8:optional list<list<double>> matrix,
}